<link rel="stylesheet" type="text/css" media="screen" href="@{'/public/stylesheets/play-pagination.css'}"> 
<div id="content">
#{ifErrors}
        <p class="error">
            &{'error.newrequest.deletehimself'} 
        </p>
    #{/ifErrors}
   
<table class="tableau">
<tr>
  <th>&{'table.requesttype.id'}</th>
  <th>&{'table.usermanager.isactif'}</th>
  <th>&{'table.usermanager.isadmin'}</th>
  <th>&{'table.usermanager.name'}</th>
  <th>&{'table.usermanager.email'}</th>
  <th>&{'table.usermanager.type'}</th>
  <th>&{'table.usermanager.action'}</th>
  
</tr>



#{list items:userList, as:'user'}
 	<tr class="${user_parity}">
	  <td>${user.getId()}</td>
	  <td>${user.getActive()}</td>
	  <td>${user.getAdmin()}</td>
	  <td>${user.getFullName()}</td>
	  <td>${user.getEmail()}</td>
	  <td>${types.get(new Long(user.getTypeId()-1L).intValue()).getDescription()}</td>
	  <td align="center" >
			<a href="#" onclick="update(${user.getId()})" ><img src="@{'public/images/edit.png'}" width="25" height="25"/></a>
	  		<a href="#" onclick="deleteType(${user.getId()})"><img src="@{'public/images/trash.png'}" width="25" height="25"/></a>
	  </td>
	</tr>
#{/list}

 
 </table>
 </div>
 <script>
//suppression d'un userType
function deleteType(id) {
	var createAction = #{jsAction @ManageUser.deleteUser(':userId') /}
	// Call Create Action
	$.post(createAction({userId:id}), function(data) {
		// Prepend Results to the List
		$('#content').replaceWith(data);
	});
}

//mise a jour d'un requestType
function update(id) {
	var createAction = #{jsAction @ManageUser.edit(':userId') /}
	//Call Create Action
	$.post(createAction({userId:id}), function(data) {
		// Prepend Results to the List
		$('#content').replaceWith(data);
	});
	}
</script>